home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibt40s1.arc / DISPCDOS.MOD < prev    next >
Text File  |  1987-09-22  |  6KB  |  132 lines

  1. (*----------------------------------------------------------------------*)
  2. (* Display_Character_Through_DOS --- show character received from port  *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Display_Character_Through_DOS( Ch: CHAR );
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Display_Character_Through_Dos                        *)
  10. (*                                                                      *)
  11. (*     Purpose:    Displays character received from comm. port on       *)
  12. (*                 screen/printer/capture file.                         *)
  13. (*                                                                      *)
  14. (*     Calling Sequence:                                                *)
  15. (*                                                                      *)
  16. (*        Display_Character_Through_Dos( Ch : CHAR );                   *)
  17. (*                                                                      *)
  18. (*           Ch         --- Character received from Comm. port.         *)
  19. (*                                                                      *)
  20. (*      Calls:   Capture_Char                                           *)
  21. (*               Update_Review_Pointers                                 *)
  22. (*                                                                      *)
  23. (*----------------------------------------------------------------------*)
  24.  
  25. VAR
  26.    I    : INTEGER;
  27.  
  28. BEGIN (* Display_Character_Through_DOS *)
  29.  
  30.                                    (* Select display depending on *)
  31.                                    (* character.                  *)
  32.    CASE ORD( Ch ) OF
  33.  
  34.       CR   :       IF Add_LF THEN
  35.                       BEGIN
  36.  
  37.                          IF Capture_On THEN
  38.                             Capture_Char( CHR( LF ) );
  39.  
  40.                          IF Printer_On THEN
  41.                             WRITE( Lst , CHR( CR ) , CHR( LF ) );
  42.  
  43.                          INLINE(
  44.                                  $B4/$02 {  MOV    AH,2    ;DOS display character function}
  45.                                 /$B2/<CR {  MOV    DL,<CR  ;Character to display}
  46.                                 /$CD/$21 {  INT    $21     ;Call DOS}
  47.                                );
  48.  
  49.                          INLINE(
  50.                                  $B4/$02 {  MOV    AH,2    ;DOS display character function}
  51.                                 /$B2/<LF {  MOV    DL,<LF  ;Character to display}
  52.                                 /$CD/$21 {  INT    $21     ;Call DOS}
  53.                                );
  54.  
  55.                          IF Review_On THEN
  56.                             Update_Review_Pointers;
  57.  
  58.                       END
  59.                    ELSE
  60.                       BEGIN
  61.  
  62.                          INLINE(
  63.                                  $B4/$02 {  MOV    AH,2    ;DOS display character function}
  64.                                 /$B2/<CR {  MOV    DL,<CR  ;Character to display}
  65.                                 /$CD/$21 {  INT    $21     ;Call DOS}
  66.                                );
  67.  
  68.                          IF Printer_On THEN
  69.                             WRITE( Lst , CHR( CR ) );
  70.  
  71.                       END;
  72.  
  73.       LF   :       IF NOT Add_LF THEN
  74.                       BEGIN
  75.                          IF Capture_On THEN
  76.                             Capture_Char( CHR( LF ) );
  77.                          INLINE(
  78.                                  $B4/$02 {  MOV    AH,2    ;DOS display character function}
  79.                                 /$B2/<LF {  MOV    DL,<LF  ;Character to display}
  80.                                 /$CD/$21 {  INT    $21     ;Call DOS}
  81.                                );
  82.                          IF Printer_On THEN
  83.                             WRITE( Lst , CHR( LF ) );
  84.                          IF Review_On THEN
  85.                             Update_Review_Pointers;
  86.                       END;
  87.  
  88.       VT, FF:      BEGIN
  89.                       IF Capture_On THEN
  90.                          Capture_Char( Ch );
  91.                       IF Printer_On THEN
  92.                          WRITE( Lst , Ch );
  93.                       INLINE(
  94.                               $B4/$02     {  MOV    AH,2        ;DOS display character function}
  95.                              /$8A/$56/<CH {  MOV    DL,[BP+<Ch] ;Character to display}
  96.                              /$CD/$21     {  INT    $21         ;Call DOS}
  97.                             );
  98.                       IF Review_On THEN
  99.                          Update_Review_Pointers;
  100.                    END;
  101.  
  102.       ELSE         BEGIN
  103.  
  104.                       INLINE(
  105.                               $B4/$02     {  MOV    AH,2        ;DOS display character function}
  106.                              /$8A/$56/<CH {  MOV    DL,[BP+<Ch] ;Character to display}
  107.                              /$CD/$21     {  INT    $21         ;Call DOS}
  108.                             );
  109.  
  110.                       IF Capture_On THEN
  111.                          Capture_Char( Ch );
  112.  
  113.                       IF Printer_On THEN
  114.                          WRITE( Lst , Ch );
  115.  
  116.                       IF Review_On THEN
  117.                          BEGIN
  118.                             I := SUCC( ORD( Review_Line[0] ) );
  119.                             IF ( I < Max_Review_Line_Length ) THEN
  120.                                BEGIN
  121.                                   Review_Line[I] := Ch;
  122.                                   Review_Line[0] := CHR( I );
  123.                                END;
  124.                          END;
  125.  
  126.                    END;
  127.  
  128.  
  129.       END;
  130.  
  131. END   (* Display_Character_Through_Dos *);
  132.